﻿@model ParticipacionVecinalWeb.Models.ParticipacionVecinal.IV
@{
    ViewBag.Title = "IV";
    Layout = "~/Views/Shared/_LayoutMaster.cshtml";
    int fila = 1;
}


@section ScriptsSection {
    <script src="@Url.Content("~/Scripts/ParticipacionVecinal/IniciativaVecinal/IV.js")"></script>
}

<div class="form-inline" id="idContenedor">
    <input type="hidden" id="hidId" value="@(Model.ID)" />

    <h1 class="page-header">Registro de Iniciativa Vecinal</h1>
    <hr />

    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>N° de Iniciativa</label><br>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtNroIniciativa" value="@(Model.C)" class="form-control" style="width: 100%" disabled />
            </div>
        </div>
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Fecha de Registro</label><br>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtFeRegistro" value="@Model.FE" class="form-control" style="width: 100%"   />
            </div>
        </div>
    </div>

    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Hora</label><br>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtHora" value="@(Model.HO)" class="form-control" style="width: 100%"   />
            </div>
        </div>
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Responsable</label><br>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtResponsable" value="@Model.R" class="form-control" style="width: 100%" disabled />
            </div>
        </div>
    </div>


    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Sector</label><br>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtSector" value="@(Model.S)" class="form-control" style="width: 100%" disabled />
            </div>
        </div>
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>SubSector</label><br>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtSubsector" value="@Model.SE" class="form-control" style="width: 100%" disabled />
            </div>
        </div>
    </div>

    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-3">
                <label>Descripción corta de Iniciativa</label>
            </div>
            <div class="col-xs-6 col-sm-3">
                <input id="txtDescripcion" value="@Model.D" class="form-control" style="width: 100%"   />
            </div>
        </div>
    </div>
    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <button type="button" class="btn btn-primary" id="btnVecino" onclick="fnAddVecino();">
                <span class="glyphicon glyphicon-saved"></span>&nbsp; &nbsp;Añadir Vecino
            </button>
        </div>
    </div>
    <!--    -----------------------------------------------------------------------------  -->
    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10" data-role="grid">

            <div class="k-grid k-widget">
                <div class="k-grid-header">
                    <div class="k-grid-header-wrap">
                        <table role="grid">
                            <thead>
                                <tr>
                                    <th class="k-header" style="display: none;">Id</th>
                                    <th class="k-header" style="display: none;">Fl</th>
                                    <th class="k-header">Dni</th>
                                    <th class="k-header">Nombre</th>
                                    <th class="k-header">Dirección</th>
                                    <th class="k-header">Acción</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
                <div class="k-grid-content">
                    <table role="grid" id="tblVecino">
                        <tbody role="rowgroup">
                            @foreach (var item in Model.V) {

                                <tr @(fila % 2 == 0 ? "" : "class='k-alt'") >
                                    <td role="gridcell" style="display: none;">@item.ID</td>
                                    <td role="gridcell" style="display: none;">1</td>
                                    <td role="gridcell">@item.N</td>
                                    <td role="gridcell">@item.AP</td>
                                    <td role="gridcell">@item.AM</td>
                                    <td role="gridcell">
                                        <div class="k-grid-historico k-button" onclick="fn_EliminarFila(this);">
                                            <span class="k-icon k-i-maximize"></span>&nbsp;&nbsp;Eliminar'
                                        </div>
                                    </td>
                                </tr>
                                fila++;
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--    -----------------------------------------------------------------------------  -->

    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">
            <div class="col-xs-6 col-sm-9">
                <label>Detalla de Iniciativa</label><br>
            </div>
            <div class="col-xs-6 col-sm-3">
            </div>
        </div>
    </div>


    <div class="row show-grid" style="margin-top: 10px;">
        <div class="col-md-10">

            <textarea id="txtDetllaIV" cols="100" rows="5">@Model.DE</textarea>

        </div>
    </div>


    @if (Model.ID <= 0) { 
        <div class='modal-footer'>
            <button type="button" class="btn btn-primary" id="btnFaltanteGuardar" onclick="fnGuardarIniciativa();">
                <span class="glyphicon glyphicon-saved"></span>&nbsp; &nbsp;Guardar
            </button>
            <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="fnRetroceder()">
                <span class="glyphicon glyphicon-remove"></span>&nbsp; &nbsp;Cerrar
            </button>
        </div>
    } else {
        <div class='modal-footer'>
            <button type="button" class="btn btn-primary" id="btnFaltanteGuardar" onclick="fnActualizarIniciativa();">
                <span class="glyphicon glyphicon-saved"></span>&nbsp; &nbsp;Actualizar
            </button>
            <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="fnRetroceder()">
                <span class="glyphicon glyphicon-remove"></span>&nbsp; &nbsp;Cerrar
            </button>
        </div>
    }

</div>

<!--    -----------------------------------------------------------------------------  -->


<!--    -----------------------------------------------------------------------------  -->






<div class="modal fade" id="ModalIniciativa" role="dialog" aria-labelledby="headerSSTSustento" aria-hidden="true" data-backdrop="static" data-keyboard="false" style="width: auto;">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="max-width: 800px; width: 100%;">
            <div class="modal-header modal-header-primary">
                <h4 class="modal-title" id="titleSustento" style="color: #ffffff;">Busqueda de Vecino</h4>
            </div>
            <div class="modal-body">
                <form class="contact" id="Form7">
                    <div id="divIniciativa" class="row show-grid" style="margin-top: 10px;">
                        <!--------------------------------------------------------------------------------->
                        <div id="divSustentoSD" style="height: auto!important;">
                            <div class="row show-grid" style="margin-top: 10px;">
                                <div class="col-md-12">
                                    <div class="col-md-2 col-xs-3">
                                        <label>Nombre</label><br>
                                    </div>
                                    <div class="col-md-2 col-xs-3 ">
                                        <input id="txtNomVecino" class="form-control" style="width: 100%" />
                                    </div>
                                </div>
                            </div>

                            <div class="row show-grid" style="margin-top: 10px;">
                                <div class="col-md-12">
                                    <div class="col-md-2 col-xs-3">
                                        <label>Tipo de Doc</label><br>
                                    </div>
                                    <div class="col-md-2 col-xs-3 ">
                                        <select id="cboTipoDoc" class="form-control input-sm">
                                            <option value="0">Seleccione</option>
                                            <option value="1">DNI</option>
                                            <option value="2">Pasaporte</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row show-grid" style="margin-top: 10px;">
                                <div class="col-md-12">
                                    <div class="col-md-2 col-xs-3">
                                        <label>N° Doc Identidad</label>
                                    </div>
                                    <div class="col-md-2 col-xs-3 ">
                                        <input type="text" id="txtNroDoc" class="form-control" style="width: 100%" />

                                    </div>
                                </div>
                            </div>


                            <div class="row show-grid" style="margin-top: 10px;">
                                <div class="col-md-12">

                                    <div class="col-md-2 col-xs-3" style="text-align: right">
                                        <button type="button" class="btn btn-primary" onclick="fn_BuscarVecino();">
                                            <span class="glyphicon glyphicon-search"></span>&nbsp; &nbsp;Buscar
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <div class="row" style="margin-top: 10px;">
                                <div id="gridVecino" style="margin-left: 12px; margin-right: 12px;"></div>
                            </div>
                            <!--------------------------------------------------------------------------------->
                        </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">
                    <span class="glyphicon glyphicon-remove"></span>&nbsp; &nbsp;Cerrar
                </button>
            </div>
        </div>
    </div>
</div>



